<%@ page language="java" import="com.wyq.jpa.model.*" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<% pageContext.setAttribute("ctx",request.getContextPath());%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>管理后台登陆</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- Bootstrap -->
    <link rel="stylesheet" href="${ctx}/resources/bootstrap3.03/css/bootstrap.css">

    <style>

        body {
            padding-top: 20px;
        }
        h1 {
            font-family: "Abel", Arial, sans-serif;
            font-weight: 400;
            font-size: 40px;
        }
        .margin-base-vertical {
            margin: 40px 0;
        }
        .panel {
            background-color: rgba(255, 255, 255, 0.9);
            border: 1px solid #e5e5e5;
        }
        .mybody{
            background-color: #f5f5f5;
        }
    </style>
</head>
<body class="mybody">
<div class="container" >
    <div class="row">
        <div  id="loginDiv" class="col-md-4 col-md-offset-4 panel" >

            <h1 class="margin-base-vertical">请登陆</h1>
            <form action="${ctx}/admin/login" method="post" class="">
                <p class="input-group" style="width: 100%">
                    <span class="input-group-addon glyphicon glyphicon-user" style="top:0px"></span>
                    <input type="text" class="form-control input-lg" name="username" placeholder="用户名" />
                </p>
                <p class="input-group" style="width: 100%">
                    <span class="input-group-addon glyphicon glyphicon-lock" style="top:0px"></span>
                    <input type="password" class="form-control input-lg" name="password" placeholder="密码" />
                </p>
                <p>
                    <label>
                        <input type="checkbox"> 记住我
                    </label>
                </p>
                <p class="text-center">
                    <button type="submit" class="btn btn-primary btn-lg" style="width: 30%">登陆</button>
                </p>
                <p>
                    <a href="javascript:;" id="toRegist">注册</a> <a href="javascript:;" id="findPwd">找回密码</a>
                </p>
                <c:if test="${!empty error}">
                    <div class="alert alert-danger" id="error">
                        ${error}
                    </div>
                </c:if>
            </form>

        </div>
        <div  id="registerDiv" class="col-md-4 col-md-offset-4 panel" style="display: none">

            <h1 class="margin-base-vertical" style="margin-bottom: 20px">注册</h1>
            <p>输入您的详细信息</p>
            <form action="${ctx}/admin/login" method="post" class="">
                <p class="input-group" style="width: 100%">
                    <span class="input-group-addon glyphicon glyphicon-user" style="top:0px"></span>
                    <input type="text" class="form-control input-lg" name="username" placeholder="用户名" />
                </p>
                <p class="input-group" style="width: 100%">
                    <span class="input-group-addon glyphicon glyphicon-lock" style="top:0px"></span>
                    <input type="password" class="form-control input-lg" name="password" placeholder="密码" />
                </p>
                <p class="input-group" style="width: 100%">
                    <span class="input-group-addon glyphicon glyphicon-lock" style="top:0px"></span>
                    <input type="repassword" class="form-control input-lg" name="repassword" placeholder="重复密码" />
                </p>
                <p class="input-group" style="width: 100%">
                    <span class="input-group-addon glyphicon glyphicon-briefcase" style="top:0px"></span>
                    <input type="text" class="form-control input-lg" name="email" placeholder="邮箱" />
                </p>
                <p>
                    <label>
                        <input type="checkbox"> 我同意隐私协议
                    </label>
                </p>
                <p class="text-left">
                    <button type="button" id="back" class="btn btn-primary btn-lg" style="width: 30%">返回</button>
                    <button type="submit" class="btn btn-primary btn-lg" style="width: 30%;">注册</button>
                </p>
                <c:if test="${!empty rerror}">
                    <div class="alert alert-danger" id="rerror">
                            ${rerror}
                    </div>
                </c:if>
            </form>

        </div>
        <div  id="forgetDiv" class="col-md-4 col-md-offset-4 panel" style="display: none">

            <h1 class="margin-base-vertical">找回密码</h1>
            <form action="${ctx}/admin/login" method="post" class="">
                <p class="input-group" style="width: 100%">
                    <span class="input-group-addon glyphicon glyphicon-briefcase" style="top:0px"></span>
                    <input type="text" class="form-control input-lg" name="forgetEmail" placeholder="邮箱" />
                </p>
                <p class="text-center">
                    <button type="button" id="forgetBack" class="btn btn-primary btn-lg" style="width: 30%">返回</button>
                    <button type="submit" class="btn btn-primary btn-lg" style="width: 30%">找回密码</button>
                </p>
                <c:if test="${!empty ferror}">
                    <div class="alert alert-danger" id="ferror">
                            ${ferror}
                    </div>
                </c:if>
            </form>

        </div>
    </div>
</div>
<script src="${ctx}/resources/bootstrap3.03/js/jquery-1.7.2.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="${ctx}/resources/bootstrap3.03/js/bootstrap.js"></script>
<script src="${ctx}/resources/app/css/admin/js/login.js"></script>
</body>
</html>